#!/usr/bin/env python3
# -*- coding: utf-8 -*-


# L = [['Apple', 'Google', 'Microsoft'],['Java', 'Python', 'Ruby', 'PHP'],['Adam', 'Bart', 'Lisa']]

#打印Apple
#print(L[0][0])
#print(L[1][1])
#print(L[2][2])


# age = 3
# if age >18:
#     print('adult')
# elif age >= 6:
#     print('teenager')
# else:
#     print('kid')


# s = input('birth:')
# birth = int(s)
# if birth < 2000:
#     print('00前')
# else:
#     print('00后')


# names = ['ww','zz','gg']
# for name in names:
#     print('挨个打印一遍:'+name)


# sum = 0
# for x in [1,2,3,4,5,6,7,8,9,10]:
#     sum = sum + x
# print(sum)


# print(list(range(10)))


# sum = 0
# for x in range(101):
#     sum = sum + x
# print(sum)


# sum = 0
# n = 99
# while n > 0:
#     sum = sum + n
#     n = n - 2
# print(sum)


# L = ['B','C','A']
# for name in L:
#     print("Hello, "+ name)


# n = 1
# while n <= 100:
#     if n > 10:
#         break
#     print(n)
#     n = n + 1
# print('END')


# n = 0
# while n < 10:
#     n = n + 1
#     if n % 2 == 0:
#         continue
#     print(n)


# d = {'A':95,'B':75,'C':85}
# d['A'] = 66
# print(d['A'])
# print('A' in d)
# print(d.get('B'))
# print(d.get('D'))
# print(d.get('D',-1))
# d.pop('C')
# print(d)


# s = set([1,2,3])
# print(s)

# s = set([1,1,2,2,2,2,2,3,4,5])
# # print(s)
# s.add(6)
# print(s)
# s.remove(1)
# print(s)


# s1 = set([1,2,3])
# s2 = set([2,3,4])
# print(s1 & s2)
# print(s1 | s2)


# a = ['a','d','c']
# a.sort()
# print(a)


#函数
#abs()  求绝对值
# print(abs(100))
# print(abs(-100))

#max 求最值
# print(max(1,3,10,1000,2))

#数据类型转换
# print(int(12.34))

#函数名其实是指向一个函数对象的引用，完全可以把函数名赋给一个变量，相当于给这个函数齐了“别名”
# a = abs
# print(a(-200))

# a = int(input("请输入一个整数："))
# print("数字" + str(a) + "对应的十六制为：" + hex(a))


#定义函数  格式：def name(values):
def my_abs(x):
    if x > 10:
        return x
    else:
        return -x

print(my_abs(9))